(function(e) {
	var a = [],
		d = /^url\(["']?([^"'\)]*)["']?\);?$/i,
		c = /\.png$/i,
		b = e.browser.msie && e.browser.version == 6;

	function f() {
		e.each(a, function() {
			this.refresh(true)
		})
	}
	e(window).resize(f);
	e.Poshytip = function(h, g) {
		this.$elm = e(h);
		this.opts = e.extend({}, e.fn.poshytip.defaults, g);
		this.$tip = e(['<div class="', this.opts.className, '">', '<div class="tip-inner tip-bg-image"></div>', '<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>', "</div>"].join("")).appendTo(document.body);
		this.$arrow = this.$tip.find("div.tip-arrow");
		this.$inner = this.$tip.find("div.tip-inner");
		this.disabled = false;
		this.content = null;
		this.init()
	};
	e.Poshytip.prototype = {
		init: function() {
			a.push(this);
			var g = this.$elm.attr("title");
			this.$elm.data("title.poshytip", g !== undefined ? g : null).data("poshytip", this);
			if (this.opts.showOn != "none") {
				this.$elm.bind({
					"mouseenter.poshytip": e.proxy(this.mouseenter, this),
					"mouseleave.poshytip": e.proxy(this.mouseleave, this)
				});
				switch (this.opts.showOn) {
				case "hover":
					if (this.opts.alignTo == "cursor") {
						this.$elm.bind("mousemove.poshytip", e.proxy(this.mousemove, this))
					}
					if (this.opts.allowTipHover) {
						this.$tip.hover(e.proxy(this.clearTimeouts, this), e.proxy(this.mouseleave, this))
					}
					break;
				case "focus":
					this.$elm.bind({
						"focus.poshytip": e.proxy(this.show, this),
						"blur.poshytip": e.proxy(this.hide, this)
					});
					break
				}
			}
		},
		mouseenter: function(g) {
			if (this.disabled) {
				return true
			}
			this.$elm.attr("title", "");
			if (this.opts.showOn == "focus") {
				return true
			}
			this.clearTimeouts();
			this.showTimeout = setTimeout(e.proxy(this.show, this), this.opts.showTimeout)
		},
		mouseleave: function(g) {
			if (this.disabled || this.asyncAnimating && (this.$tip[0] === g.relatedTarget || jQuery.contains(this.$tip[0], g.relatedTarget))) {
				return true
			}
			var h = this.$elm.data("title.poshytip");
			if (h !== null) {
				this.$elm.attr("title", h)
			}
			if (this.opts.showOn == "focus") {
				return true
			}
			this.clearTimeouts();
			this.hideTimeout = setTimeout(e.proxy(this.hide, this), this.opts.hideTimeout)
		},
		mousemove: function(g) {
			if (this.disabled) {
				return true
			}
			this.eventX = g.pageX;
			this.eventY = g.pageY;
			if (this.opts.followCursor && this.$tip.data("active")) {
				this.calcPos();
				this.$tip.css({
					left: this.pos.l,
					top: this.pos.t
				});
				if (this.pos.arrow) {
					this.$arrow[0].className = "tip-arrow tip-arrow-" + this.pos.arrow
				}
			}
		},
		show: function() {
			if (this.disabled || this.$tip.data("active")) {
				return
			}
			this.reset();
			this.update();
			this.display();
			if (this.opts.timeOnScreen) {
				setTimeout(e.proxy(this.hide, this), this.opts.timeOnScreen)
			}
		},
		hide: function() {
			if (this.disabled || !this.$tip.data("active")) {
				return
			}
			this.display(true)
		},
		reset: function() {
			this.$tip.queue([]).detach().css("visibility", "hidden").data("active", false);
			this.$inner.find("*").poshytip("hide");
			if (this.opts.fade) {
				this.$tip.css("opacity", this.opacity)
			}
			this.$arrow[0].className = "tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left";
			this.asyncAnimating = false
		},
		update: function(j, k) {
			if (this.disabled) {
				return
			}
			var i = j !== undefined;
			if (i) {
				if (!k) {
					this.opts.content = j
				}
				if (!this.$tip.data("active")) {
					return
				}
			} else {
				j = this.opts.content
			}
			var h = this,
				g = typeof j == "function" ? j.call(this.$elm[0], function(l) {
					h.update(l)
				}) : j == "[title]" ? this.$elm.data("title.poshytip") : j;
			if (this.content !== g) {
				this.$inner.empty().append(g);
				this.content = g
			}
			this.refresh(i)
		},
		refresh: function(h) {
			if (this.disabled) {
				return
			}
			if (h) {
				if (!this.$tip.data("active")) {
					return
				}
				var k = {
					left: this.$tip.css("left"),
					top: this.$tip.css("top")
				}
			}
			this.$tip.css({
				left: 0,
				top: 0
			}).appendTo(document.body);
			if (this.opacity === undefined) {
				this.opacity = this.$tip.css("opacity")
			}
			var l = this.$tip.css("background-image").match(d),
				m = this.$arrow.css("background-image").match(d);
			if (l) {
				var i = c.test(l[1]);
				if (b && i) {
					this.$tip.css("background-image", "none");
					this.$inner.css({
						margin: 0,
						border: 0,
						padding: 0
					});
					l = i = false
				} else {
					this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>').css({
						border: 0,
						padding: 0,
						"background-image": "none",
						"background-color": "transparent"
					}).find(".tip-bg-image").css("background-image", 'url("' + l[1] + '")').end().find("td").eq(3).append(this.$inner)
				}
				if (i && !e.support.opacity) {
					this.opts.fade = false
				}
			}
			if (m && !e.support.opacity) {
				if (b && c.test(m[1])) {
					m = false;
					this.$arrow.css("background-image", "none")
				}
				this.opts.fade = false
			}
			var o = this.$tip.find("table");
			if (b) {
				this.$tip[0].style.width = "";
				o.width("auto").find("td").eq(3).width("auto");
				var n = this.$tip.width(),
					j = parseInt(this.$tip.css("min-width")),
					g = parseInt(this.$tip.css("max-width"));
				if (!isNaN(j) && n < j) {
					n = j
				} else {
					if (!isNaN(g) && n > g) {
						n = g
					}
				}
				this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")
			} else {
				if (o[0]) {
					o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find("td").eq(3).width("100%")
				}
			}
			this.tipOuterW = this.$tip.outerWidth();
			this.tipOuterH = this.$tip.outerHeight();
			this.calcPos();
			if (m && this.pos.arrow) {
				this.$arrow[0].className = "tip-arrow tip-arrow-" + this.pos.arrow;
				this.$arrow.css("visibility", "inherit")
			}
			if (h) {
				this.asyncAnimating = true;
				var p = this;
				this.$tip.css(k).animate({
					left: this.pos.l,
					top: this.pos.t
				}, 200, function() {
					p.asyncAnimating = false
				})
			} else {
				this.$tip.css({
					left: this.pos.l,
					top: this.pos.t
				})
			}
		},
		display: function(h) {
			var i = this.$tip.data("active");
			if (i && !h || !i && h) {
				return
			}
			this.$tip.stop();
			if ((this.opts.slide && this.pos.arrow || this.opts.fade) && (h && this.opts.hideAniDuration || !h && this.opts.showAniDuration)) {
				var m = {},
					l = {};
				if (this.opts.slide && this.pos.arrow) {
					var k, g;
					if (this.pos.arrow == "bottom" || this.pos.arrow == "top") {
						k = "top";
						g = "bottom"
					} else {
						k = "left";
						g = "right"
					}
					var j = parseInt(this.$tip.css(k));
					m[k] = j + (h ? 0 : (this.pos.arrow == g ? -this.opts.slideOffset : this.opts.slideOffset));
					l[k] = j + (h ? (this.pos.arrow == g ? this.opts.slideOffset : -this.opts.slideOffset) : 0) + "px"
				}
				if (this.opts.fade) {
					m.opacity = h ? this.$tip.css("opacity") : 0;
					l.opacity = h ? 0 : this.opacity
				}
				this.$tip.css(m).animate(l, this.opts[h ? "hideAniDuration" : "showAniDuration"])
			}
			h ? this.$tip.queue(e.proxy(this.reset, this)) : this.$tip.css("visibility", "inherit");
			this.$tip.data("active", !i)
		},
		disable: function() {
			this.reset();
			this.disabled = true
		},
		enable: function() {
			this.disabled = false
		},
		destroy: function() {
			this.reset();
			this.$tip.remove();
			delete this.$tip;
			this.content = null;
			this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip");
			a.splice(e.inArray(this, a), 1)
		},
		clearTimeouts: function() {
			if (this.showTimeout) {
				clearTimeout(this.showTimeout);
				this.showTimeout = 0
			}
			if (this.hideTimeout) {
				clearTimeout(this.hideTimeout);
				this.hideTimeout = 0
			}
		},
		calcPos: function() {
			var n = {
				l: 0,
				t: 0,
				arrow: ""
			},
				h = e(window),
				k = {
					l: h.scrollLeft(),
					t: h.scrollTop(),
					w: h.width(),
					h: h.height()
				},
				p, j, m, i, q, g;
			if (this.opts.alignTo == "cursor") {
				p = j = m = this.eventX;
				i = q = g = this.eventY
			} else {
				var o = this.$elm.offset(),
					l = {
						l: o.left,
						t: o.top,
						w: this.$elm.outerWidth(),
						h: this.$elm.outerHeight()
					};
				p = l.l + (this.opts.alignX != "inner-right" ? 0 : l.w);
				j = p + Math.floor(l.w / 2);
				m = p + (this.opts.alignX != "inner-left" ? l.w : 0);
				i = l.t + (this.opts.alignY != "inner-bottom" ? 0 : l.h);
				q = i + Math.floor(l.h / 2);
				g = i + (this.opts.alignY != "inner-top" ? l.h : 0)
			}
			switch (this.opts.alignX) {
			case "right":
			case "inner-left":
				n.l = m + this.opts.offsetX;
				if (n.l + this.tipOuterW > k.l + k.w) {
					n.l = k.l + k.w - this.tipOuterW
				}
				if (this.opts.alignX == "right" || this.opts.alignY == "center") {
					n.arrow = "left"
				}
				break;
			case "center":
				n.l = j - Math.floor(this.tipOuterW / 2);
				if (n.l + this.tipOuterW > k.l + k.w) {
					n.l = k.l + k.w - this.tipOuterW
				} else {
					if (n.l < k.l) {
						n.l = k.l
					}
				}
				break;
			default:
				n.l = p - this.tipOuterW - this.opts.offsetX;
				if (n.l < k.l) {
					n.l = k.l
				}
				if (this.opts.alignX == "left" || this.opts.alignY == "center") {
					n.arrow = "right"
				}
			}
			switch (this.opts.alignY) {
			case "bottom":
			case "inner-top":
				n.t = g + this.opts.offsetY;
				if (!n.arrow || this.opts.alignTo == "cursor") {
					n.arrow = "top"
				}
				if (n.t + this.tipOuterH > k.t + k.h) {
					n.t = i - this.tipOuterH - this.opts.offsetY;
					if (n.arrow == "top") {
						n.arrow = "bottom"
					}
				}
				break;
			case "center":
				n.t = q - Math.floor(this.tipOuterH / 2);
				if (n.t + this.tipOuterH > k.t + k.h) {
					n.t = k.t + k.h - this.tipOuterH
				} else {
					if (n.t < k.t) {
						n.t = k.t
					}
				}
				break;
			default:
				n.t = i - this.tipOuterH - this.opts.offsetY;
				if (!n.arrow || this.opts.alignTo == "cursor") {
					n.arrow = "bottom"
				}
				if (n.t < k.t) {
					n.t = g + this.opts.offsetY;
					if (n.arrow == "bottom") {
						n.arrow = "top"
					}
				}
			}
			this.pos = n
		}
	};
	e.fn.poshytip = function(h) {
		if (typeof h == "string") {
			var g = arguments,
				k = h;
			Array.prototype.shift.call(g);
			if (k == "destroy") {
				this.die("mouseenter.poshytip").die("focus.poshytip")
			}
			return this.each(function() {
				var l = e(this).data("poshytip");
				if (l && l[k]) {
					l[k].apply(l, g)
				}
			})
		}
		var i = e.extend({}, e.fn.poshytip.defaults, h);
		if (!e("#poshytip-css-" + i.className)[0]) {
			e(['<style id="poshytip-css-', i.className, '" type="text/css">', "div.", i.className, "{visibility:hidden;position:absolute;top:0;left:0;}", "div.", i.className, " table, div.", i.className, " td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}", "div.", i.className, " td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:", i.bgImageFrameSize, "px;width:", i.bgImageFrameSize, "px;overflow:hidden;}", "div.", i.className, " td.tip-right{background-position:100% 0;}", "div.", i.className, " td.tip-bottom{background-position:100% 100%;}", "div.", i.className, " td.tip-left{background-position:0 100%;}", "div.", i.className, " div.tip-inner{background-position:-", i.bgImageFrameSize, "px -", i.bgImageFrameSize, "px;}", "div.", i.className, " div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}", "</style>"].join("")).appendTo("head")
		}
		if (i.liveEvents && i.showOn != "none") {
			var j = e.extend({}, i, {
				liveEvents: false
			});
			switch (i.showOn) {
			case "hover":
				this.live("mouseenter.poshytip", function() {
					var l = e(this);
					if (!l.data("poshytip")) {
						l.poshytip(j).poshytip("mouseenter")
					}
				});
				break;
			case "focus":
				this.live("focus.poshytip", function() {
					var l = e(this);
					if (!l.data("poshytip")) {
						l.poshytip(j).poshytip("show")
					}
				});
				break
			}
			return this
		}
		return this.each(function() {
			new e.Poshytip(this, i)
		})
	};
	e.fn.poshytip.defaults = {
		content: "[title]",
		className: "tip-yellow",
		bgImageFrameSize: 10,
		showTimeout: 500,
		hideTimeout: 100,
		timeOnScreen: 0,
		showOn: "hover",
		liveEvents: false,
		alignTo: "cursor",
		alignX: "right",
		alignY: "top",
		offsetX: -22,
		offsetY: 18,
		allowTipHover: true,
		followCursor: false,
		fade: true,
		slide: true,
		slideOffset: 8,
		showAniDuration: 300,
		hideAniDuration: 300
	}
})(jQuery);
function rC(C) {
	var D;
	D = C + "=";
	offset = document.cookie.indexOf(D);
	if (offset != -1) {
		offset += D.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1) {
			end = document.cookie.length
		}
		return unescape(document.cookie.substring(offset, end))
	} else {
		return ""
	}
}
//id属性的调用
(function($) {
	var g = $(window),
		options, images, activeImage = -1,
		activeURL, prevImage, nextImage, ie6 = ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)),
		browserIsCrap, middleX, middleY, imageX, imageY, currentSize, initialSize, imageDrag, timer, fitsOnScreen, preload = {},
		preloadPrev = new Image(),
		preloadNext = new Image(),
		overlay, closeBtn, image, prevBtn, nextBtn, prevBtna, nextBtna, bottom, caption, nav, number, fxOverlay, fxResize, zoomed = "pbzoomed",
		greyed = "pbgreyed";
	$(document).ready(function() {
		$(document.body).append($([overlay = $('<div id="pbOverlay" />').click(close)[0], image = $('<img id="pbImage" />').dblclick(doubleClick)[0], closeBtn = $('<div id="pbCloseBtn" title="关闭" />').click(close)[0], bottom = $('<div id="pbBottom" />').append([number = $('<div id="pbNumber" />')[0], caption = $('<div id="pbCaption" />')[0], $('<div id="pbNav" />').append([prevBtn = $('<a id="pbPrevBtn" title="上一张(按键←快速翻页)" href="#" />').click(previous)[0], zoomBtn = $('<a id="pbZoomBtn" title="切换图片大小(双击图片)" href="#" />').click(doubleClick)[0], nextBtn = $('<a id="pbNextBtn" title="下一张(按键→快速翻页)" href="#" />').click(next)[0], prevBtna = $('<a id="pbPrevBtna" title="上一张(按键←快速翻页)" href="#" />').click(previous)[0], nextBtna = $('<a id="pbNextBtna" title="下一张(按键→快速翻页)" href="#" />').click(next)[0]])[0]])[0]]).css("display", "none"));
		browserIsCrap = ie6 || (overlay.currentStyle && (overlay.currentStyle.position != "fixed"));
		if (browserIsCrap) {
			$([overlay, closeBtn, image, bottom]).css("position", "absolute")
		}
		$(image).tinyDrag(function() {
			var i = $(image),
				pos = i.position();
			imageX = (pos.left - g.scrollLeft()) + i.width() / 2;
			imageY = (pos.top - g.scrollTop()) + i.height() / 2;
			$(zoomBtn).addClass(zoomed)
		})
	});
	$.picbox = function(a, b, c) {
		options = $.extend({
			loop: false,
			overlayOpacity: 0.8,
			overlayFadeDuration: 200,
			resizeDuration: 300,
			resizeEasing: "swing",
			controlsFadeDelay: 99999999,
			counterText: "{x}/{y}",
			hideFlash: true,
			closeKeys: [27, 88, 67],
			previousKeys: [37, 80],
			nextKeys: [39, 78],
			margins: 30
		}, c || {});
		if (typeof a == "string") {
			a = [
				[a, b]
			];
			b = 0
		}
		$(overlay).css("opacity", 0).fadeTo(options.overlayFadeDuration, options.overlayOpacity);
		$(bottom).css("display", "");
		mouseMove();
		position();
		setup(1);
		images = a;
		options.loop = options.loop && (images.length > 1);
		return changeImage(b)
	};
	$.fn.picbox = function(c, d, e) {
		d = d ||
		function(a) {
			return [a.href, a.title]
		};
		e = e ||
		function() {
			return true
		};
		var f = this;
		$(f).unbind("click").click(function() {
			var b = this,
				linksMapped = [];
			filteredLinks = $.grep(f, function(a) {
				return e.call(b, a)
			});
			for (var i = 0; i < filteredLinks.length; i++) linksMapped[i] = d(filteredLinks[i]);
			return $.picbox(linksMapped, $.inArray(this, filteredLinks), c)
		});
		return f
	};

	function position() {
		var a = {
			x: g.scrollLeft(),
			y: g.scrollTop()
		};
		middleX = g.width() / 2;
		middleY = g.height() / 2;
		if (browserIsCrap) {
			middleX = middleX + a.x;
			middleY = middleY + a.y;
			$(overlay).css({
				left: a.x,
				top: a.y,
				width: g.width(),
				height: g.height()
			})
		}
		$(image).css({
			top: middleY,
			left: middleX,
			width: '1px',
			height: '1px'
		})
	}
	function setup(b) {
		if (options.hideFlash) {
			$.each(["object", "embed"], function(i, a) {
				$(a).each(function() {
					if (b) this._picbox = this.style.visibility;
					this.style.visibility = b ? "hidden" : this._picbox
				})
			})
		}
		overlay.style.display = closeBtn.style.display = "";
		var c = b ? "bind" : "unbind";
		$(document)[c]("keydown", keyDown);
		$(document)[c]("mousewheel", scrollZoom);
		$(document)[c]("mousemove", mouseMove);
		$(bottom)[c]("mouseover", function() {
			preventFade(1)
		});
		$(bottom)[c]("mouseout", preventFade)
	}
	function keyDown(a) {
		var b = a.keyCode;
		return $.inArray(b, options.closeKeys) >= 0 ? close() : $.inArray(b, options.nextKeys) >= 0 ? next() : $.inArray(b, options.previousKeys) >= 0 ? previous() : false
	}
	function mouseMove() {
		flashFade([bottom, prevBtn, prevBtna, zoomBtn, nextBtn, nextBtna])
	}
	function flashFade(a, b) {
		clearTimeout(timer);
		$(a).fadeIn();
		a = b ? $.merge(a, b) : a;
		timer = setTimeout(function() {
			$(a).fadeOut()
		}, options.controlsFadeDelay)
	}
	function preventFade(a) {
		var b = 1 == a ? "unbind" : "bind";
		$(document)[b]("mousemove", mouseMove);
		clearTimeout(timer)
	}
	function previous() {
		return changeImage(prevImage, true)
	}
	function next() {
		return changeImage(nextImage, true)
	}
	function changeImage(a, b) {
		if (a >= 0) {
			activeImage = a;
			activeURL = images[a][0];
			prevImage = (activeImage || (options.loop ? images.length : 0)) - 1;
			nextImage = ((activeImage + 1) % images.length) || (options.loop ? 0 : -1);
			stop();
			overlay.className = "pbLoading";
			$(image).css("display", "none");
			if (!images[activeImage][1]) $(caption).html("").hide();
			else $(caption).html(images[activeImage][1]).show();
			$(number).html((((images.length > 1) && options.counterText) || "").replace(/{x}/, activeImage + 1).replace(/{y}/, images.length));
			if (prevImage >= 0) {
				preloadPrev.src = images[prevImage][0];
				$(prevBtn).removeClass(greyed);
				$(prevBtna).removeClass(greyed)
			}
			if (nextImage >= 0) {
				preloadNext.src = images[nextImage][0];
				$(nextBtn).removeClass(greyed);
				$(nextBtna).removeClass(greyed)
			}
			preload = new Image();
			preload.onload = function() {
				showImage(b)
			};
			preload.src = activeURL
		}
		return false
	}
	function showImage(a) {
		resetImageCenter();
		var b = g.width() - options.margins,
			mh = g.height() - options.margins,
			size = 1;
		if ((preload.width > b) || (preload.height > mh)) {
			size = Math.min(b / preload.width, mh / preload.height);
			$(zoomBtn).removeClass(greyed);
			fitsOnScreen = false
		} else {
			$(zoomBtn).addClass(greyed);
			fitsOnScreen = true
		}
		currentSize = initialSize = size;
		resizeImage(size, a);
		$(image).attr("src", activeURL);
		$(image).css("display", "");
		overlay.className = "";
		flashFade([bottom], [prevBtn, prevBtna, zoomBtn, nextBtn, nextBtna])
	}
	function resizeImage(a, b) {
		var c = a / currentSize;
		imageX = middleX - (middleX - imageX) * c;
		imageY = middleY - (middleY - imageY) * c;
		currentSize = a;
		var d = preload.width * a,
			height = preload.height * a,
			left = imageX - (d / 2) >> 0,
			top = imageY - (height / 2) >> 0,
			dur = b ? 0 : options.resizeDuration,
			fn = (0 == a) ?
		function() {
			$(image).hide()
		} : function() {};
		$(image).animate({
			width: d,
			height: height,
			top: top,
			left: left
		}, {
			queue: false,
			duration: dur,
			easing: options.resizeEasing,
			complete: fn
		});
		return false
	}
	function resetImageCenter() {
		imageX = middleX;
		imageY = middleY
	}
	function scrollZoom(e, a) {
		$(zoomBtn).addClass(zoomed);
		var b = currentSize + a * currentSize / 10;
		return resizeImage(b)
	}
	function doubleClick() {
		if (currentSize == initialSize && imageX == middleX && imageY == middleY && !fitsOnScreen) {
			$(zoomBtn).addClass(zoomed);
			return resizeImage(1)
		} else {
			$(zoomBtn).removeClass(zoomed);
			resetImageCenter();
			return resizeImage(initialSize)
		}
	}
	function stop() {
		preload.onload = function() {};
		preload.src = preloadPrev.src = preloadNext.src = activeURL;
		$(image).stop();
		$([prevBtn, nextBtn, prevBtna, nextBtna]).addClass(greyed);
		$(zoomBtn).removeClass(zoomed)
	}
	function close() {
		if (activeImage >= 0) {
			stop();
			activeImage = prevImage = nextImage = -1;
			resizeImage(0);
			setup();
			$(bottom).stop().hide();
			$(overlay).stop().fadeOut();
			$(closeBtn).stop().hide()
		}
		return false
	}
	$.fn.tinyDrag = function(a) {
		return $.tinyDrag(this, a)
	};
	$.tinyDrag = function(a, b) {
		var c, elStart, moved, doc = $(document),
			abs = Math.abs;
		a.mousedown(function(e) {
			moved = false;
			c = {
				x: e.pageX,
				y: e.pageY
			};
			elStart = {
				x: parseInt(a.css("left")),
				y: parseInt(a.css("top"))
			};
			doc.mousemove(drag).mouseup(stop);
			return false
		});

		function drag(e) {
			var x = e.pageX,
				y = e.pageY;
			if (moved) {
				a.css({
					left: elStart.x + (x - c.x),
					top: elStart.y + (y - c.y)
				})
			} else {
				if (abs(x - c.x) > 1 || abs(y - c.y) > 1) moved = true
			}
			return false
		}
		function stop() {
			doc.unbind("mousemove", drag).unbind("mouseup");
			moved && b && b()
		}
		return a
	};
	var h = ['DOMMouseScroll', 'mousewheel'];
	if ($.event.fixHooks) {
		for (var i = h.length; i;) {
			$.event.fixHooks[h[--i]] = $.event.mouseHooks
		}
	}
	$.event.special.mousewheel = {
		setup: function() {
			if (this.addEventListener) {
				for (var i = h.length; i;) {
					this.addEventListener(h[--i], handler, false)
				}
			} else {
				this.onmousewheel = handler
			}
		},
		teardown: function() {
			if (this.removeEventListener) {
				for (var i = h.length; i;) {
					this.removeEventListener(h[--i], handler, false)
				}
			} else {
				this.onmousewheel = null
			}
		}
	};
	$.fn.extend({
		mousewheel: function(a) {
			return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
		},
		unmousewheel: function(a) {
			return this.unbind("mousewheel", a)
		}
	});

	function handler(a) {
		var b = a || window.event,
			args = [].slice.call(arguments, 1),
			delta = 0,
			returnValue = true,
			deltaX = 0,
			deltaY = 0;
		a = $.event.fix(b);
		a.type = "mousewheel";
		if (b.wheelDelta) {
			delta = b.wheelDelta / 120
		}
		if (b.detail) {
			delta = -b.detail / 3
		}
		deltaY = delta;
		if (b.axis !== undefined && b.axis === b.HORIZONTAL_AXIS) {
			deltaY = 0;
			deltaX = -1 * delta
		}
		if (b.wheelDeltaY !== undefined) {
			deltaY = b.wheelDeltaY / 120
		}
		if (b.wheelDeltaX !== undefined) {
			deltaX = -1 * b.wheelDeltaX / 120
		}
		args.unshift(a, delta, deltaX, deltaY);
		return ($.event.dispatch || $.event.handle).apply(this, args)
	}
})(jQuery);

jQuery(function($) {
		$("#gallery div a").attr("rel", "lightbox-g");
		if (rC("stip") != 'n') {
			$("#pbBottom").append("<div id='stip'>提示:键盘 ← → 可快速翻页,Esc快速关闭预览,图片可拖动查看,鼠标滚轮可缩放图片,双击图片切换图片大小!<span>不再提示</span></div>")
		}
		$("#stip span").click(function() {
			$("#stip").hide();
			wC("stip", "n")
		});

		$("#pbPrevBtn,#pbZoomBtn,#pbNextBtn,#newmbdemo,#pbCloseBtn").poshytip({
			className: "tip-twitter",
			showTimeout: 0,
			hideTimeout: 0,
			alignTo: "target",
			alignX: "center",
			alignY: "top",
			offsetX: 0,
			offsetY: 8,
			allowTipHover: false,
			fade: false,
			slide: false
		});
		$("#gallery div a").picbox({}, null, function(a) {
			return (this == a) || ((this.rel.length > 8) && (this.rel == a.rel))
		});
		$('#gallery a').bind('focus', function() {
			if (this.blur) {
				this.blur()
			}
		})
	})

